home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Menu / c / PopUpAuto < prev    next >
Text File  |  1995-07-08  |  1KB  |  34 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Menu.PopUpAuto.c
  12.     Author:  Copyright © 1994 Tony Houghton
  13.     Version: 1.00 (25 Sep 1994)
  14.     Purpose: Pop up a menu to the right of a button icon, finding the icon from
  15.              event_lastevent
  16. */
  17.  
  18. #include "DeskLib:Menu.h"
  19. #include "DeskLib:WimpSWIs.h"
  20. #include "DeskLib:Event.h"
  21.  
  22. void Menu_PopUpAuto(menu_ptr menu)
  23. {
  24.   if (event_lastevent.type != event_CLICK)
  25.     return;
  26.   if (event_lastevent.data.mouse.window == -1 ||
  27.       event_lastevent.data.mouse.window == window_ICONBAR)
  28.     return;
  29.   if (event_lastevent.data.mouse.icon == -1)
  30.     return;
  31.   Menu_PopUp(menu, event_lastevent.data.mouse.window,
  32.                    event_lastevent.data.mouse.icon);
  33. }
  34.